# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mqtt-exec
pkgver=0.5
pkgrel=3
pkgdesc="simple MQTT client that executes a command on messages"
url="https://github.com/ncopa/mqtt-exec"
arch="all"
license="MIT"
makedepends="$depends_dev mosquitto-dev"
options="!check" # no checks available.
subpackages="$pkgname-dbg $pkgname-openrc"
source="mqtt-exec-$pkgver.tar.gz::https://github.com/ncopa/mqtt-exec/archive/v$pkgver.tar.gz
	mqtt-exec.initd
	mqtt-exec.confd
	"

build() {
	make
}

package() {
	install -D mqtt-exec "$pkgdir"/usr/bin/mqtt-exec

	install -Dm755 "$srcdir"/mqtt-exec.initd "$pkgdir"/etc/init.d/mqtt-exec
	install -Dm644 "$srcdir"/mqtt-exec.confd "$pkgdir"/etc/conf.d/mqtt-exec
}

sha512sums="
55746aabe17d47153c01549a65f0db9278a39dc642e355b8416e905934a3abe233eb0ad763ae8add08bf6c3ad8ccaa97e9bac4372c8af6fea522f6670378acd7  mqtt-exec-0.5.tar.gz
a5f918d9d874052211b8610c9686fde0b2641402c9be3aebd347083109d7457946d47dd99ebb4b765fddc264651a3182ed816a082add262d11c1a0157089ab60  mqtt-exec.initd
f402e7a44d69a8fc09aa46a9922a68b21264281d69deeb61bdb8ec842b3f9c1ef8b7d83826997f9722c84f8ab15631dfdc55d9cfc416b3db1613c3ddcd53330e  mqtt-exec.confd
"
